﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Demos.DesignPatterns._07_适配器模式
{
    public class PaypalService
    {
        public bool MakePayment(string account, decimal amount)
        {
            Console.WriteLine($"Paypal支付：向{account}支付 {amount}元");
            return new Random().Next(100) > 10; // 模拟90%成功率
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="paymentId"></param>
        /// <returns></returns>
        public string GetPayPalPaymentStatus(string paymentId)
        {
            return new Random().Next(100) > 10 ? "支付成功" : "支付失败";
        }
    }

}
